<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>局部组件</title>
    <script src="js/vue.js"></script>
    <style>
        .tempateStyle{
            border: 1px dashed #000;
            border-radius: 15px;
            padding: 10px;
            width: 200px;
            height: 160px;
            text-align: center;
            float: left;
            margin-right: 50px;
            margin-bottom: 50px;
            box-shadow:10px 10px 5px #888888;
            background-image: linear-gradient(to bottom right, red, yellow);
        }
        .tempateStyle1{
            border: 1px dashed #000;
            border-radius: 15px;
            padding: 10px;
            width: 200px;
            height: 260px;
            text-align: center;
            float: left;
            margin-right: 50px;
            margin-bottom: 50px;
            box-shadow:10px 10px 5px #888888;
            background-image: linear-gradient(to bottom right, pink, red);
        }
    </style>
</head>
<body>
    <template id="t1">
        <div class="tempateStyle">
            <h3>润物无声</h3>
            <h4>只做增强不做改变，引入它不会对现有工程产生影响，如丝般顺滑</h4>
        </div>
    </template>
    <template id="t2">
        <div class="tempateStyle1">
            <div>
                <img src="images/userface4.jpg">
            </div>
            <div>
                <span style="font-weight: bold;">{{describle}}</span>
            </div>
        </div>
    </template>
    <div id="app">
        <div>
            <infoitem></infoitem>
            <infoitem></infoitem>
            <infoitem></infoitem>
            <infoitem></infoitem>
        </div>
       <div style="clear: both;">
           <imgitem></imgitem>
           <imgitem></imgitem>
           <imgitem></imgitem>
           <imgitem></imgitem>
       </div>

    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        components:{   //定义局部组件的
            'infoitem':{
                template:'#t1'
            },
            'imgitem':{
                template:'#t2',
                data:function(){
                    return{
                        describle:'小姐姐'
                    }
                }
            }
        }
    });
</script>